//插入系统日志
function InsertSysLog(pagetitle, page, operation, userrealname, userno, detail)
{
    $.ajax(
    {
        url : '../../api/insertSystemLog',
        method : 'get',
        dataType : 'json',
        data :
        {
            pagetitle : pagetitle,
            page : page,
            operation : operation,
            userrealname : realname,
            userno : userno,
            detail : detail
        },
        success : function (r)
        {
            if (r == 1)
            {
                //结束从表的编辑状态，获取最新值
                datagrid1.datagrid('acceptChanges');
                $.messager.show(
                {
                    msg : r.msg,
                    title : '成功'
                }
                );

                //重新加载datadatagrid1
                datagrid1.datagrid('reload');
            }
            else
            {

                $.messager.alert('错误', r.msg, 'error');
            }
            //取消选择所有当前页中所有的行。
            datagrid1.datagrid('unselectAll');
        }
    }
    );

}

// 订单操作追踪日志
function saveOrderTracksRecord(orderno, userrole, userno, username, operation, remarks, operationtime, adduser, addtime)
{

    $.ajax(
    {
        url : '../../api/saveOrderTracksRecord',
        method : 'get',
        dataType : 'json',
        data :
        {
            orderno : orderno,
            userrole : rolename,
            userno : userno,
            username : realname,
            operation : operation,
            remarks : remarks,
            operationtime : operationtime,
            adduser : realname,
            addtime : addtime
        },
        success : function ()
        {
            $.messager.alert('操作提示', "已经成功跟踪！");
        },
        error : function (e)
        {
            $.messager.alert('操作提示', "错误：" + e);
        }
    }
    );
}

// 问题跟踪记录
function saveProblemRecord(testnum, orderstatus, pushuserno, pushusername, pushtime, receiveusername, receiveuserno, browsetime, isbrowseflag, problemmodule, problemtitle)
{
    $.ajax(
    {
        url : '../../api/insertProblemRecord',
        method : 'get',
        dataType : 'json',
        data :
        {
            testnum : orderno,
            orderstatus : orderstatus,
            pushuserno : userno,
            pushusername : realname,
            pushtime : pushtime,
            receiveusername : receiveusername,
            receiveuserno : receiveuserno,
            browsetime : browsetime,
            isbrowseflag : isbrowseflag,
            problemmodule : problemmodule,
            problemtitle : problemtitle
        },
        success : function ()
        {
            $.messager.alert('操作提示', "已经成功跟踪！");
        },
        error : function (e)
        {
            $.messager.alert('操作提示', "错误：" + e);
        }
    }
    );
}
